home *** CD-ROM | disk | FTP | other *** search
/ Aminet 32 / Aminet 32 (1999)(Schatztruhe)[!][Aug 1999].iso / GoldED / Add-Ons / envWRD44 / Install < prev    next >
Text File  |  1999-07-06  |  21KB  |  718 lines

  1. ; $VER: Words 4
  2. ; Installer script ©1996 Dietmar Eilert
  3.  
  4. (delopts "oknodelete" "force" "askuser")
  5. (complete 0)
  6.  
  7. (onerror (
  8.  
  9.     (if (> @ioerr 0) 
  10.  
  11.         " Some error has occurred. Please inform a GoldED \n"
  12.         " support site (e.g. dietmar@tomate.tng.oche.de)  \n"
  13.         " AFTER having tried a different Installer release\n"
  14.         " (1.24 is known to work fine).                   \n"
  15.     )
  16. ))
  17.  
  18. (if (exists "GOLDED:" (NOREQ))
  19.  
  20.     (
  21.         (set vernum (getversion "golded:golded"))
  22.  
  23.         (set ver (/ vernum 65536))
  24.         (set rev (- vernum (* ver 65536)))
  25.  
  26.         (set version (+ (* 10 ver) rev))
  27.  
  28.         (if (< version 47)
  29.  
  30.             (
  31.                 (message "\nSorry, GoldED 4.7.0 or better required")
  32.                 (exit (quiet))
  33.             )
  34.         )
  35.  
  36.         (if (not (exists "libs/ixemul.library"))
  37.  
  38.             (if (not (exists "libs:ixemul.library"))
  39.  
  40.                 (
  41.                     (message "\nSorry, libs:ixemul.library required (AmiNet).")
  42.  
  43.                     (exit (quiet))
  44.                 )
  45.             )
  46.         )
  47.  
  48.         (complete 5)
  49.  
  50.         (message (cat "\n"
  51.  
  52.             "Words · Spellchecking for GoldED            \n"
  53.             "                                            \n"
  54.             "©'96/ Heinz Knutzen, Martin Schulz, Loren J.\n"
  55.             " '97  Rittle, Jesper Skov, Dietmar Eilert.  \n"
  56.             "                                            \n"
  57.             "      Commercial distribution not permitted.\n"
  58.             "      All files are the property of their   \n"
  59.             "      authors unless stated otherwise.      \n"
  60.             "                                            \n"
  61.             "Requirements:                               \n"
  62.             "                                            \n"
  63.             "GoldED 4.7.0+, ixemul.library, 5 MB RAM     \n"
  64.         ))
  65.  
  66.         (welcome)
  67.  
  68.         (complete 10)
  69.  
  70.         (set action (askoptions
  71.  
  72.             (prompt "\nSelect parts to be installed\n")
  73.  
  74.             (help @askoptions-help)
  75.  
  76.             (default 5)
  77.  
  78.             (choices
  79.  
  80.                 "Install binaries"
  81.                 "Install dictionary: German"
  82.                 "Install dictionary: English"
  83.             )
  84.         ))
  85.  
  86.         (complete 15)
  87.  
  88.         ; install binaries
  89.  
  90.         (if (in action 0) (
  91.  
  92.             (if (not (exists "golded:api"))
  93.  
  94.                 (makedir "golded:api")
  95.             )
  96.  
  97.             (if (not (exists "golded:syntax"))
  98.  
  99.                 (makedir "golded:syntax")
  100.             )
  101.  
  102.             ; install registry editor (if not yet installed)
  103.  
  104.             (if (not (exists "golded:tools"))
  105.  
  106.                 (makedir "golded:tools")
  107.             )
  108.  
  109.             (if (not (exists "golded:tools/regedit"))
  110.  
  111.                 (makedir "golded:tools/regedit")
  112.             )
  113.  
  114.             (copylib
  115.  
  116.                 (prompt "Install registry editor ?")
  117.                 (source "bin/regedit" )
  118.                 (dest   "golded:tools/regedit")
  119.                 (confirm)
  120.                 (help @copylib-help)
  121.             )
  122.  
  123.             ; install syntax parser
  124.  
  125.             (copylib
  126.  
  127.                 (prompt "Install syntax parser ?")
  128.                 (source "syntax/warpSPELL.parser")
  129.                 (dest   "golded:syntax")
  130.                 (confirm)
  131.                 (help @copylib-help)
  132.             )
  133.  
  134.             (if (exists "libs/ixemul.library")
  135.  
  136.                 ; install ixemul.library (required by ISpell)
  137.  
  138.                 (copylib
  139.  
  140.                     (prompt "Install ixemul.library ?")
  141.                     (source "libs/ixemul.library")
  142.                     (dest "libs:")
  143.                     (help @copylib-help)
  144.                     (confirm)
  145.                 )
  146.             )
  147.  
  148.             ; install ISpell
  149.  
  150.             (if (exists "ispell:" (quiet))
  151.  
  152.                 (set target (pathonly (expandpath "ispell:")))
  153.                 (set target "sys:")
  154.             )
  155.  
  156.             (set target (askdir
  157.  
  158.                 (prompt
  159.  
  160.                     (cat "\n"
  161.  
  162.                         "Select path for ISpell installation. The drawer \n"
  163.                         "'ISpell' is created in the directory you select:\n"
  164.                     )
  165.                 )
  166.  
  167.                 (help "A new drawer is created in the path you specify.")
  168.  
  169.                 (default target)
  170.             ))
  171.  
  172.             ; $HOME is required by ISpell; the GETENV command is broken, so we have to use EXISTS
  173.  
  174.             (if (not (exists "env:home" (NOREQ)))
  175.  
  176.                 (run "echo >envarc:HOME sys:")
  177.                 (run "echo >env:HOME    sys:")
  178.             )
  179.  
  180.             (complete 20)
  181.  
  182.             (set target (tackon target "ispell"))
  183.  
  184.             (if (not (exists target))
  185.  
  186.                 (makedir target)
  187.             )
  188.  
  189.             (makeassign "ispell" target)
  190.  
  191.             (if (not (exists "ispell:bin"))
  192.  
  193.                 (makedir "ispell:bin")
  194.             )
  195.  
  196.             (if (not (exists "ispell:doc"))
  197.  
  198.                 (makedir "ispell:doc")
  199.             )
  200.  
  201.             (if (not (exists "ispell:lib"))
  202.  
  203.                 (makedir "ispell:lib")
  204.             )
  205.  
  206.             (working "Installing ISpell...")
  207.  
  208.             (copyfiles
  209.  
  210.                 (source "ispell-3.1.18bin/bin")
  211.                 (dest   "ispell:bin")
  212.                 (all)
  213.                 (nogauge)
  214.             )
  215.  
  216.             (copyfiles
  217.  
  218.                 (source "ispell-3.1.18bin/doc")
  219.                 (dest   "ispell:doc")
  220.                 (all)
  221.                 (nogauge)
  222.             )
  223.  
  224.             (startup "WORDS"
  225.  
  226.                 (prompt "Add ISpell: assign to your user-startup ?")
  227.  
  228.                 (help @startup-help)
  229.  
  230.                 (command ("ASSIGN >NIL: ispell: %s\nPATH ISPELL:BIN ADD" target))
  231.             )
  232.  
  233.             (complete 25)
  234.  
  235.             ; install API client
  236.  
  237.             (copylib
  238.  
  239.                 (prompt "Install API client ?")
  240.                 (source "api/words.api")
  241.                 (dest   "golded:api")
  242.                 (confirm)
  243.                 (help @copylib-help)
  244.             )
  245.  
  246.             (if (not (exists "golded:tools/words"))
  247.  
  248.                 (makedir "golded:tools/words")
  249.             )
  250.  
  251.             ; install support files
  252.  
  253.             (copyfiles
  254.  
  255.                 (source "words")
  256.                 (dest   "golded:tools/words")
  257.                 (all)
  258.                 (nogauge)
  259.             )
  260.  
  261.             (copyfiles
  262.  
  263.                 (source  "")
  264.                 (dest    "golded:tools/words")
  265.                 (pattern "#?.readme")
  266.                 (nogauge)
  267.             )
  268.  
  269.             ; install toolbar images
  270.  
  271.             (if (exists "toolbar") (
  272.  
  273.                 (set hicolor
  274.  
  275.                     (askchoice
  276.  
  277.                         (prompt "\nSelect toolbar style:\n")
  278.  
  279.                         (choices
  280.  
  281.                             "4  colors"
  282.                             "8+ colors"
  283.                         )
  284.  
  285.                         (default 1)
  286.  
  287.                         (help (cat "\n"
  288.  
  289.                             " You can use both styles on all screens. The 4\n"
  290.                             " color style has been optimized for 4-color   \n"
  291.                             " screens. The 8+ style has been optimized for \n"
  292.                             " screens with eight or more colors.           \n"
  293.                         ))
  294.                     )
  295.                 )
  296.  
  297.                 (if (not (exists "golded:toolbar"))
  298.  
  299.                     (makedir "golded:toolbar")
  300.                 )
  301.  
  302.                 (if (not (exists "golded:toolbar/words"))
  303.  
  304.                     (makedir "golded:toolbar/words")
  305.                 )
  306.  
  307.                 (copyfiles
  308.  
  309.                     (source "toolbar")
  310.                     (dest   "golded:toolbar")
  311.                     (all)
  312.                     (nogauge)
  313.                 )
  314.  
  315.                 (if (= hicolor 1)
  316.  
  317.                     (copyfiles
  318.  
  319.                         (source "toolbar16")
  320.                         (dest   "golded:toolbar")
  321.                         (nogauge)
  322.                         (all)
  323.                     )
  324.                 )
  325.             ))
  326.  
  327.             (complete 30)
  328.  
  329.         ))
  330.  
  331.         ; install German dictionary
  332.  
  333.         (complete 35)
  334.  
  335.         (if (in action 1) (
  336.  
  337.             ; set default ISpell options
  338.  
  339.             (copyfiles
  340.  
  341.                 (source "env/d")
  342.                 (dest "env:")
  343.                 (all)
  344.                 (nogauge)
  345.             )
  346.  
  347.             (copyfiles
  348.  
  349.                 (source "env/d")
  350.                 (dest "envarc:")
  351.                 (all)
  352.                 (nogauge)
  353.             )
  354.  
  355.             (set partsA (askoptions
  356.  
  357.                 (prompt "Select German dictionaries to be installed (1/2)")
  358.  
  359.                 (help (cat "\n"
  360.  
  361.                     " The more dictionaries you select, the more \n"
  362.                     " memory ISpell will use. File sized listed  \n"
  363.                     " are NOT RAM requirements - RAM requirements\n"
  364.                     " are about three times higher.              \n"
  365.                 ))
  366.  
  367.                 (choices
  368.  
  369.                     "Substantive        (250 K)"
  370.                     "Verben             (120 K)"
  371.                     "Adjektive & Co     ( 10 K)"
  372.                     "Zusammensetzungen  (550 K)"
  373.                     "Geographie         ( 15 K)"
  374.                     "Namen              (  5 K)"
  375.                     "Abkuerzungen       (  1 K)"
  376.                     "Imperative         (  1 K)"
  377.                     "Latein             (  1 K)"
  378.                 )
  379.  
  380.                 (default 503)
  381.             ))
  382.  
  383.             (complete 40)
  384.  
  385.             (set partsB (askoptions
  386.  
  387.                 (prompt "Select German dictionaries to be installed (2/2)")
  388.  
  389.                 (help (cat "\n"
  390.  
  391.                     " The more dictionaries you select, the more \n"
  392.                     " memory ISpell will use. File sized listed  \n"
  393.                     " are NOT RAM requirements - RAM requirements\n"
  394.                     " are about three times higher.              \n"
  395.                 ))
  396.  
  397.                 (choices
  398.  
  399.                     "Informatik, EDV    ( 25 K)"
  400.                     "Elektronik         ( 10 K)"
  401.                     "Organisationen     (  1 K)"
  402.                     "Marken             (  1 K)"
  403.                     "Griechisch         (  1 K)"
  404.                     "Roemische Zahlen   (  1 K)"
  405.                     "Technik            (  2 K)"
  406.                     "Seltenes           ( 10 K)"
  407.                 )
  408.  
  409.                 (default 12)
  410.             ))
  411.  
  412.             (complete 45)
  413.  
  414.             (if (or (<> partsA 0) (<> partsB 0)) (
  415.  
  416.                 (working "\nCreating dictionary, sorting entries. May take some minutes.\n")
  417.  
  418.                 (delete "dictionary/deutsch/words/all.words.cnt")
  419.                 (delete "dictionary/deutsch/words/all.words.stat")
  420.  
  421.                 (set cmd "bin/joinsorted >con://///AUTO DIR=dictionary/deutsch/words as=dictionary/deutsch/words/all.words ")
  422.  
  423.                 (if (in partsA 0) (set cmd (cat cmd "worte.txt "      )))
  424.                 (if (in partsA 1) (set cmd (cat cmd "verben.txt "     )))
  425.                 (if (in partsA 2) (set cmd (cat cmd "klein.txt "      )))
  426.                 (if (in partsA 2) (set cmd (cat cmd "adjektive.txt "  )))
  427.                 (if (in partsA 3) (set cmd (cat cmd "zusammen.txt "   )))
  428.                 (if (in partsA 4) (set cmd (cat cmd "geographie.txt " )))
  429.                 (if (in partsA 4) (set cmd (cat cmd "geogra2.txt "    )))
  430.                 (if (in partsA 5) (set cmd (cat cmd "namen.txt "      )))
  431.                 (if (in partsA 5) (set cmd (cat cmd "vornamen.txt "   )))
  432.                 (if (in partsA 5) (set cmd (cat cmd "vornam2.txt "    )))
  433.                 (if (in partsA 6) (set cmd (cat cmd "abkuerz.txt "    )))
  434.                 (if (in partsA 6) (set cmd (cat cmd "abkuerz2.txt "   )))
  435.                 (if (in partsA 7) (set cmd (cat cmd "imperat.txt "    )))
  436.                 (if (in partsA 8) (set cmd (cat cmd "latein.txt "     )))
  437.  
  438.                 (if (in partsB 0) (set cmd (cat cmd "compeng.txt "    )))
  439.                 (if (in partsB 0) (set cmd (cat cmd "infoabk.txt "    )))
  440.                 (if (in partsB 0) (set cmd (cat cmd "informatik.txt " )))
  441.                 (if (in partsB 1) (set cmd (cat cmd "elektronik.txt " )))
  442.                 (if (in partsB 2) (set cmd (cat cmd "orgabk.txt "     )))
  443.                 (if (in partsB 3) (set cmd (cat cmd "marken.txt "     )))
  444.                 (if (in partsB 4) (set cmd (cat cmd "alphabeta.txt "  )))
  445.                 (if (in partsB 5) (set cmd (cat cmd "roemisch.txt "   )))
  446.                 (if (in partsB 6) (set cmd (cat cmd "technik.txt "    )))
  447.                 (if (in partsB 7) (set cmd (cat cmd "seltenes.txt "   )))
  448.  
  449.                 (run cmd)
  450.  
  451.                 (if (exists "dictionary/deutsch/words/all.words" (noreq))
  452.  
  453.                     (
  454.                         (working "\nChecking dictionary. May take some minutes.\n")
  455.  
  456.                         (run "bin/ifilter >con://///AUTO FILE=dictionary/deutsch/words/all.words NOTEX")
  457.  
  458.                         (complete 50)
  459.  
  460.                         (if (exists "ispell:lib/deutsch.hash")
  461.  
  462.                             (set remove (askbool
  463.  
  464.                                 (prompt "\nOverwrite old hash file (ispell:lib/deutsch.hash) ?")
  465.  
  466.                                 (help "You might want to backup your old file :-)")
  467.  
  468.                                 (choices
  469.  
  470.                                     "overwrite"
  471.                                     "exit"
  472.                                 )
  473.                             ))
  474.  
  475.                             (set remove 1);
  476.                         )
  477.  
  478.                         (if (= remove 1)
  479.  
  480.                             (
  481.                                 (delete "ispell:lib/deutsch.hash")
  482.  
  483.                                 (working "\nCreating hash file supporting fast data access. May take some minutes and LOTS of RAM.\n")
  484.  
  485.                                 (complete 55)
  486.  
  487.                                 (run "ispell:bin/buildhash >NIL: -s dictionary/deutsch/words/all.words dictionary/deutsch/words/deutsch.aff ispell:lib/deutsch.hash")
  488.  
  489.                                 (complete 60)
  490.  
  491.                                 (if (exists "ispell:lib/deutsch.hash")
  492.  
  493.                                     (
  494.                                         (copyfiles
  495.  
  496.                                             (source "dictionary/deutsch/words/deutsch.aff")
  497.                                             (dest "ispell:lib")
  498.                                             (nogauge)
  499.                                         )
  500.  
  501.                                         (message (cat "\nHash file 'ispell:lib/deutsch.hash' has been created successfully. Hash file size (ISpell RAM usage):\n\n" (getsize "ispell:lib/deutsch.hash") " Bytes"))
  502.                                     )
  503.  
  504.                                     (
  505.  
  506.                                         (message "\nFatal error: hash file creation failed (out of RAM ?).\n")
  507.  
  508.                                         (delete "language/deutsch/words/all.words")
  509.  
  510.                                         (exit (quiet))
  511.                                     )
  512.                                 )
  513.                             )
  514.                         )
  515.  
  516.                         (complete 65)
  517.  
  518.                         (delete "dictionary/deutsch/words/all.words")
  519.                     )
  520.  
  521.                     (
  522.                         (message "\nFatal error - dictionary creation failed.")
  523.  
  524.                         (exit (quiet))
  525.                     )
  526.                 )
  527.             ))
  528.         ))
  529.  
  530.         ; install English dictionary
  531.  
  532.         (complete 70)
  533.  
  534.         (if (in action 2) (
  535.  
  536.             ; set default ISpell options
  537.  
  538.             (copyfiles
  539.  
  540.                 (source "env/e")
  541.                 (dest "env:")
  542.                 (all)
  543.                 (nogauge)
  544.             )
  545.  
  546.             (copyfiles
  547.  
  548.                 (source "env/e")
  549.                 (dest "envarc:")
  550.                 (all)
  551.                 (nogauge)
  552.             )
  553.  
  554.             (set partsA (askchoice
  555.  
  556.                 (prompt "\nSelect English dictionaries to install\n")
  557.  
  558.                 (help (cat "\n"
  559.  
  560.                     " The more dictionaries you select, the more \n"
  561.                     " memory ISpell will use. File sized listed  \n"
  562.                     " are NOT RAM requirements - RAM requirements\n"
  563.                     " are about three times higher.              \n"
  564.                 ))
  565.  
  566.                 (choices
  567.  
  568.                     "  none                        "
  569.                     "  Basis             (  205 KB)"
  570.                     "+ Extensions small  (+ 149 KB)"
  571.                     "+ Extensions medium (+ 549 KB)"
  572.                     "+ Extensions large  (+ 722 KB)"
  573.                 )
  574.  
  575.                 (default 2)
  576.             ))
  577.  
  578.             (complete 75)
  579.  
  580.             (if (<> partsA 0) (
  581.  
  582.                 (working "\nCreating dictionary, sorting entries. May take some minutes.\n")
  583.  
  584.                 (delete "dictionary/english/words/all.words.cnt")
  585.                 (delete "dictionary/english/words/all.words.stat")
  586.  
  587.                 (set cmd "bin/joinsorted >con://///AUTO DIR=dictionary/english/words as=dictionary/english/words/all.words ")
  588.  
  589.                 (if (> partsA 0) (set cmd (cat cmd "english.0 american.0 british.0 ")))
  590.                 (if (> partsA 1) (set cmd (cat cmd "english.1 american.1 british.1 ")))
  591.                 (if (> partsA 2) (set cmd (cat cmd "english.2 american.2 british.2 ")))
  592.                 (if (> partsA 3) (set cmd (cat cmd "english.3 ")))
  593.  
  594.                 (run cmd)
  595.  
  596.                 (complete 80)
  597.  
  598.                 (if (exists "dictionary/english/words/all.words" (noreq))
  599.  
  600.                     (
  601.                         (if (exists "ispell:lib/english.hash")
  602.  
  603.                             (set remove (askbool
  604.  
  605.                                 (prompt "\nOverwrite old hash file (ispell:lib/english.hash) ?")
  606.  
  607.                                 (help "You might want to backup your old file :-)")
  608.  
  609.                                 (choices
  610.  
  611.                                     "overwrite"
  612.                                     "exit"
  613.                                 )
  614.                             ))
  615.  
  616.                             (set remove 1);
  617.                         )
  618.  
  619.                         (if (= remove 1)
  620.  
  621.                             (
  622.                                 (delete "ispell:lib/english.hash")
  623.  
  624.                                 (working "\nCreating hash file supporting fast data access. May take some minutes.\n")
  625.  
  626.                                 (complete 85)
  627.  
  628.                                 (run "ispell:bin/buildhash >NIL: -s dictionary/english/words/all.words dictionary/english/words/english.aff ispell:lib/english.hash")
  629.  
  630.                                 (complete 90)
  631.  
  632.                                 (if (exists "ispell:lib/english.hash")
  633.  
  634.                                     (
  635.                                         (copyfiles
  636.  
  637.                                             (source "dictionary/english/words/english.aff")
  638.                                             (dest "ispell:lib")
  639.                                             (nogauge)
  640.                                         )
  641.  
  642.                                         (message (cat "\nHash file 'ispell:lib/english.hash' has been created successfully. Hash file size (ISpell RAM usage):\n\n" (getsize "ispell:lib/english.hash") " Bytes"))
  643.                                     )
  644.  
  645.                                     (
  646.                                         (message "\nFatal error: hash file creation failed (out of RAM ?).\n")
  647.  
  648.                                         (delete "dictionary/english/words/all.words")
  649.  
  650.                                         (exit (quiet))
  651.                                     )
  652.                                 )
  653.                             )
  654.                         )
  655.  
  656.                         (complete 95)
  657.  
  658.                         (delete "dictionary/english/words/all.words")
  659.                     )
  660.  
  661.                     (
  662.                         (message "\nFatal error - dictionary creation failed.")
  663.  
  664.                         (exit (quiet))
  665.                     )
  666.                 )
  667.             ))
  668.         ))
  669.  
  670.         (if (= @language "deutsch")
  671.  
  672.             (set language 1)
  673.             (set language 0)
  674.         )
  675.  
  676.         (set language (askchoice
  677.  
  678.             (prompt "\nSelect context menu language\n")
  679.  
  680.             (help @askchoice-help)
  681.  
  682.             (choices
  683.  
  684.                 "  English"
  685.                 "  Deutsch"
  686.             )
  687.  
  688.             (default language)
  689.         ))
  690.  
  691.         ; update registry
  692.  
  693.         (if (in action 0)
  694.  
  695.             (
  696.  
  697.                 (working "Updating registry...")
  698.  
  699.                 (if (= language 0)
  700.  
  701.                     (run "golded:tools/regedit/regedit script=install.bat presets/e/words.mouse")
  702.                     (run "golded:tools/regedit/regedit script=install.bat presets/d/words.mouse")
  703.                 )
  704.             )
  705.         )
  706.  
  707.         (complete 100)
  708.     )
  709.  
  710.     (message (cat "\n"
  711.  
  712.         " Please install GoldED before attempting to\n"
  713.         " install this package.                     \n"
  714.     ))
  715. )
  716.  
  717. (exit (quiet))
  718.